#ifndef KETOGICON_H
#define KETOGICON_H


#include "../../../../kegui_global.h"

#include <QObject>
#include <QWidget>
#include <QPaintEvent>
#include <QFont>
#include <QPointF>

#include <QString>

class KEGUI_EXPORT KeTogIcon : public QWidget
{
    Q_OBJECT
public:
    explicit KeTogIcon(QWidget *parent,uint iconCode);
    bool eventFilter(QObject *watched, QEvent *event) override;
    void setIconFont(const QFont &f);
    int getTextSize() const;
    void setTextSize(int newTextSize);
    void setChecked(bool b);
    bool isChecked()const;

protected:
    void leaveEvent(QEvent *) override;
    void enterEvent(QEnterEvent *event)override;
    void mousePressEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void paintEvent(QPaintEvent *) override;


private:

    bool isWindowDeactivate,m_isMouseOver,isMouseDown,m_isChecked;
    uint m_codeIcon;
    int textSize;
    QString m_strLabel;
    QPointF ptDown;
    QFont fontIcon;

Q_SIGNALS:
    void toggled(int checked);
};

#endif // KETOGICON_H
